package com.itzb.asone.system.service.impl;

import java.util.List;

import com.itzb.asone.mybatis.Criteria;
import com.itzb.asone.system.model.SysParam;
import com.itzb.asone.system.repository.ISysParamRepository;
import com.itzb.asone.system.service.IMessageService;
import com.itzb.asone.system.service.ISysParamService;


public class SysParamServiceImpl implements ISysParamService{

	private ISysParamRepository sysParamRepository;
	private IMessageService messageService;
	
	public List<SysParam> queryPage(Criteria<SysParam> param){
		return sysParamRepository.queryPage(param);
	}

	public Integer queryPageCount(Criteria<SysParam> param){
		return sysParamRepository.queryPageCount(param);
	}

	public SysParam queryEntityById(String id){
		return sysParamRepository.queryEntityById(id);
	}

	public Integer insert(SysParam record){
		return sysParamRepository.insert(record);
	}

	public Integer updateByCriteria(Criteria<SysParam> param){
		return sysParamRepository.updateByCriteria(param);
	}

	public Integer deleteById(String id){
		return sysParamRepository.deleteById(id);
	}

	public Integer deleteByCriteria(Criteria<SysParam> param){
		return sysParamRepository.deleteByCriteria(param);
	}
	public String getParamValue(String paramCode){
		Criteria<SysParam> param = new Criteria<SysParam>();
		param.addParam("paramCode", paramCode);
		List<SysParam> list = sysParamRepository.queryPage(param);
		if(list != null && list.size()>0){
			return list.get(0).getParamVal();
		} else {
			return "";
		}
	}

	public ISysParamRepository getSysParamRepository() {
		return sysParamRepository;
	}

	public void setSysParamRepository(ISysParamRepository sysParamRepository) {
		this.sysParamRepository = sysParamRepository;
	}

	public IMessageService getMessageService() {
		return messageService;
	}

	public void setMessageService(IMessageService messageService) {
		this.messageService = messageService;
	}
	
}
